import java.awt.*;

public class Room {
    
    public int fieldWidth = 17;
    public int fieldHeight = 25;
    public int blockSize = 20;
    
    public static Block[][] block;
    
    public Room() {
        define();
    }
    
    public void define() {
        
        block = new Block[fieldHeight][fieldWidth];
        
        for (int y = 0; y < block.length; y++) {
            for (int x = 0; x < block[0].length; x++) {
                block[y][x] = new Block(x * blockSize, y * blockSize, blockSize, blockSize, 0);
            }
        }
    }
    
    public void draw(Graphics g) {
        for (int y = 0; y < block.length; y++) {
            for (int x = 0; x < block[0].length; x++) {
                block[y][x].drawTable(g);
                
                if(block[y][x].id == 1) {
                    block[y][x].draw(g);
                }
            }
        }
    }
    public void restart()
    {
        for(int row = 0; row < fieldHeight; ++row)
        {
            for(int col = 0; col < fieldWidth; ++col)
            {
                block[row][col].id = 0;
                Screen.level = 0;
                Screen.rowsCleaned = 0;
            }
        }
    }
}
